package cn.fx.operation._03_oneway;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class Producer {

    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("row_beijing_group");

        producer.setNamesrvAddr("localhost:9876");

        producer.start();

        Message message = new Message("row", "china", "解决".getBytes(StandardCharsets.UTF_8));

        producer.sendOneway(message);

        producer.shutdown();
    }
}
